import { ILv70DramaStepCommand } from "../interfaces/ILv70DramaStepCommand";
import { TDrama } from "../../../../../Message/Db/Tables/TDrama";
import { LayerManager } from "../../../manager/LayerManager";
import { Global } from "../../../../../com/gengine/global/Global";
//class Lv70OpBlackScreen
    
    export  class Lv70OpBlackScreen implements ILv70DramaStepCommand
    {
        

        public call(arg1: TDrama, arg2: Function=null): void
        {
            var data: TDrama;
            var callback: Function=null;
            var onTime: Function;

            var loc1;
            onTime = null;
            data = arg1;
            callback = arg2;
            onTime = (): void
            {
                if (callback != null) 
                {
                    callback.apply();
                }
                return;
            }
            LayerManager.highestLayer.addChild(this.sp);
            flash.utils.setTimeout(onTime, 500);
            return;
        }

        public cancel(arg1: TDrama, arg2: Function=null): void
        {
            if (this.sp.parent != null) 
            {
                this.sp.parent.removeChild(this.sp);
            }
            if (arg2 != null) 
            {
                arg2.apply();
            }
            return;
        }

        public dispose(): void
        {
            this.sp.graphics.clear();
            this._sp = null;
            return;
        }

        /* internal  */get sp(): Object /* flash.display.Sprite */
        {
            if (this._sp == null) 
            {
                this._sp = new Object /* flash.display.Sprite */();
                this._sp.graphics.beginFill(0, 1);
                this._sp.graphics.drawRect(0, 0, Global.stage.stageWidth, Global.stage.stageHeight);
                this._sp.graphics.endFill();
                this._sp.mouseChildren = false;
                this._sp.mouseEnabled = false;
            }
            return this._sp;
        }

        /* internal */ /* var */_sp: Object /* flash.display.Sprite */;
    }
